/*
 * Created by SharpDevelop.
 * User: David
 * Date: 2006-12-05
 * Time: 22:39
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Collections.Generic;

namespace Labb4.Event
{
	/// <summary>
	/// A wrapper class around an event info, or command if you will.
	/// </summary>
	public class EventInfo
	{
		#region members
		
		/// <summary>
		/// The time at which this command should be triggered
		/// </summary>
		public int				m_Time;
		/// <summary>
		/// The command to trigger
		/// </summary>
		public string			m_Task;
		/// <summary>
		/// The parameters to send to the command
		/// </summary>
		public List<string>		m_TaskSpecifics;
		
		#endregion
		
		#region constructors
		
		/// <summary>
		/// Constructor, initializes members
		/// </summary>
		/// <param name="time">The time at which to execute this command. The time is relative to
		/// the time the event was started. Unit is (ms)</param>
		/// <param name="task">The command to execute</param>
		public EventInfo(int time, string task)
		{
			m_Time = time;
			m_Task = task;
			
			m_TaskSpecifics = new List<string>();
		}
		
		#endregion
		
		#region methods
		
		/// <summary>
		/// Adds a parameter
		/// </summary>
		/// <param name="spec">The parameter value</param>
		public void AddSpecifics(string spec)
		{
			m_TaskSpecifics.Add(spec);
		}
		
		#endregion
		
		#region properties
		
		/// <summary>
		/// Number of parameters in this command (get)
		/// </summary>
		public int Count
		{
			get
			{
				return m_TaskSpecifics.Count;
			}
		}
		
		/// <summary>
		/// Parameter number [index] (get)
		/// </summary>
		public string this[int index]
		{
			get
			{
				string atIndex = "";
				
				if(m_TaskSpecifics.Count > index)
				{
					atIndex = m_TaskSpecifics[index];
				}
				
				return atIndex;
			}
		}
		
		/// <summary>
		/// The time this command should be executed (get)
		/// </summary>
		public int Time
		{
			get
			{
				return m_Time;
			}
		}
		
		/// <summary>
		/// The command to execute (get)
		/// </summary>
		public string Task
		{
			get
			{
				return m_Task;
			}
		}
		
		#endregion
	}
}
